import { mergeConfig } from 'vite';
import { defineConfig } from 'vitest/config';

import viteConfig from './vite.config';

export default mergeConfig(
    viteConfig,
    defineConfig({
        test: {
            include: ['**/*.{test,spec}.{js,ts,jsx,tsx}'],
            exclude: ['**/node_modules/**', '**/dist/**'],
            globals: true,
            environment: 'jsdom',
            update: true,
            // root: './src/index.tsx',
            coverage: {
                provider: 'c8',
            },
            mockReset: true,
            css: false,
            passWithNoTests: true,
            cache: {
                dir: './.vitest',
            },
            alias: {
                'Api/': '/src/apis/',
                Apis: '/src/apis/index',
                'App/': '/src/app/',
                'Components/': '/src/components/',
                'Common/': '/src/components/common/',
                'Configs/': '/src/configs/',
                'Constants/': '/src/constants/',
                'Core/': '/src/core/',
                'Hooks/': '/src/hooks/',
                'Locales/': '/src/locales/',
                'Mocks/': '/src/mocks/',
                'Models/': '/src/models/',
                'Pages/': '/src/pages/',
                'Routers/': '/src/routers/',
                'Typings/': '/src/typings/',
                'Utils/': '/src/utils/',
            },
        },
    }),
);
